﻿// JScript 文件

function ParseToDate(strDate)
{
    
    var dt = new Date();
    if(strDate == "" || strDate == null)
    {
        return dt;
    }
    reg_cn = /^(\d{1,4})(-|\/)(\d{1,2})(-|\/)(\d{1,2})?$/
    var r = null;
	r = strDate.match(reg_cn);
 
	if(r!=null)
	{
	    var y = r[1];
	    var m = parseFloat(r[3])-1;
	    var d = r[5];
	    dt = new Date(y,m,d);
	}
    return dt;
}
function GetDateString()
{
    var dt = new Date();
    return dt.getFullYear() + "-" + (dt.getMonth()+1) + "-" + dt.getDate();
}